/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../variables';

.segment-bar-chart-render {
  position: relative;
  overflow: hidden;

  @keyframes pulseOpacity {
    0% {
      opacity: 0.8;
    }
    100% {
      opacity: 0.95;
    }
  }

  svg {
    position: absolute;

    text {
      user-select: none;
    }

    .hover-highlight {
      fill: white;
      fill-opacity: 0.1;
    }

    .hovered-bar {
      fill: none;
      stroke: #ffffff;
      stroke-width: 1.5px;
    }

    .selection {
      fill: transparent;
      stroke: #ffffff;
      stroke-width: 1px;
      opacity: 0.8;

      &.finalized {
        opacity: 1;
      }
    }

    .shifter {
      fill: white;
      fill-opacity: 0.2;
      filter: blur(1px);
    }

    .time-shift-indicator {
      fill: white;
      fill-opacity: 0.001;
      cursor: grab;

      &:hover {
        fill-opacity: 0.1;
      }

      &.shifting {
        fill-opacity: 0.2;
        cursor: grabbing;
      }
    }

    .h-gridline {
      line {
        stroke: $white;
        stroke-dasharray: 5, 5;
        opacity: 0.5;
      }
    }

    .now-line {
      stroke: $orange4;
      stroke-dasharray: 2, 2;
      opacity: 0.7;
    }

    .bar-unit {
      &.realtime {
        animation: pulseOpacity 3s alternate infinite;
      }
    }
  }

  .rule-tape {
    position: absolute;
    top: 5px;
    height: 15px;
    font-size: 10px;

    .rule-error {
      @include pin-full();
      background-color: $red3;
      color: $white;
    }

    .load-rule {
      position: absolute;
      overflow: hidden;
      padding-left: 2px;
      border-left: 1px solid $dark-gray2;
      border-right: 1px solid $dark-gray2;
      top: 0;
      height: 100%;
      text-overflow: ellipsis;

      &.load {
        background-color: $green1;

        &:nth-child(even) {
          background-color: $green3;
        }
      }

      &.drop {
        background-color: $dark-gray5;

        &:nth-child(even) {
          background-color: $gray1;
        }
      }

      &.broadcast {
        background-color: $indigo1;

        &:nth-child(even) {
          background-color: $indigo3;
        }
      }
    }
  }

  .empty-placeholder {
    @include pin-full;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    user-select: none;
    pointer-events: none;
  }
}

.segment-bar-chart-bubble {
  .button-bar {
    padding-top: 5px;
    display: flex;
    gap: 5px;
  }
}
